<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$USER = getAccountUserObject();
	$ESCORT = $this->escort_entity->init('user_id',$USER->getId());	
	$iCount = 0;
	$totalPeriodDiscount = $totalPromoDiscount = $totalPrice = 0;
    
    $gtbillInfoArray = defineGTbillInfomation();
?>
<style>
	
</style>

<script type="text/javascript">
	
</script>

	<div id="content-left">
		<div id="personal-tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
			<div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
				<!-- content -->	
					
					<div class="dashboard-info-wrapper">
						<div class="select-box">
								<table width="100%">
									<thead>
										<th><?php echo language_translate('services_page_table_head_servicename');?></th>
										<th><?php echo language_translate('services_page_table_head_details');?></th>
										<th><?php echo language_translate('services_page_table_head_period');?></th>
										<th style="text-align:right;"><?php echo language_translate('services_page_table_head_priceeuro');?></th>
									</thead>
									<tbody>
										<?php if(isset($_SESSION['SERVICES_INFO']['SUBS'])):?>
											<tr>
												<?php 
													$subs_array = getSubcriptionData_ioc($_SESSION['SERVICES_INFO']['SUBS']['type_id']);
													$iCount++;
													$totalPeriodDiscount += $_SESSION['SERVICES_INFO']['SUBS']['period_discount_price'];
													$totalPromoDiscount += $_SESSION['SERVICES_INFO']['SUBS']['promo_discount_price'];
													$totalPrice += $_SESSION['SERVICES_INFO']['SUBS']['payment_price'];
												?>
												<td><?php echo language_translate('services_page_subscription');?></td>
												<td><?php echo $subs_array[0];?></td>
												<td><?php echo $_SESSION['SERVICES_INFO']['SUBS']['period'];?></td>
												<td style="text-align:right;"><?php echo euroCurrencyFormat(number_format( $_SESSION['SERVICES_INFO']['SUBS']['payment_price'], 2 ));?></td>
											</tr>
										<?php endif;?>
										
										<?php if(isset($_SESSION['SERVICES_INFO']['PLACE'])):?>
											<?php
												foreach($_SESSION['SERVICES_INFO']['PLACE'] as $k =>$v):
													$placeInfo = getPlaceListDataInfoById($v['type_id']);
											?>
											<?php if($placeInfo):?>
												<?php 
													$iCount++;
													$totalPeriodDiscount += $v['period_discount_price'];
													$totalPromoDiscount += $v['promo_discount_price'];
													$totalPrice += $v['payment_price'];
												?>
												<tr>
													<td><?php echo language_translate('services_page_where_do_you_work');?></td>
													<td>
														<?php echo $placeInfo['country'];?>
														<?php if($placeInfo['state']):?>
															/
															<?php echo $placeInfo['state'];?>
														<?php endif;?>
														<?php if($placeInfo['province']):?>
															/
															<?php echo $placeInfo['province'];?>
														<?php endif;?>
														<?php if($placeInfo['city']):?>
															/
															<?php echo $placeInfo['city'];?>
														<?php endif;?>
													</td>
													<td>
														<?php echo $v['period'];?>
													</td>
													<td style="text-align:right;"><?php echo euroCurrencyFormat(number_format( $v['payment_price'], 2) );?></td>
												</tr>
											<?php endif;?>
											<?php endforeach; ?>
										<?php endif;?> 
										
										<?php if(isset($_SESSION['SERVICES_INFO']['PACK'])):?>
											<?php foreach($_SESSION['SERVICES_INFO']['PACK'] as $k => $v):?>
													<?php 
														$pack_array = getPackListData_ioc($v['type_id']);
														$iCount++;
														$totalPeriodDiscount += $v['period_discount_price'];
														$totalPromoDiscount += $v['promo_discount_price'];
														$totalPrice += $v['payment_price'];
													?>
													<tr>
														<td><?php echo language_translate('services_page_add_a_pack');?></td>
														<td>
															<?php echo $pack_array[0];?>
														</td>
														<td>
															<?php echo $v['period'];?>
														</td>
														<td style="text-align:right;"><?php echo euroCurrencyFormat(number_format( $v['payment_price'], 2) );?></td>
													</tr>
											<?php endforeach; ?>
										<?php endif;?> 
										
										<?php if(isset($_SESSION['SERVICES_INFO']['PRI'])):?>
											<?php foreach($_SESSION['SERVICES_INFO']['PRI'] as $k=>$v):?>
												<?php 
													$pri_array = getPriorityData_ioc($v['type_id']);
													$iCount++;
													$totalPeriodDiscount += $v['period_discount_price'];
													$totalPromoDiscount += $v['promo_discount_price'];
													$totalPrice += $v['payment_price'];
												?>
												<tr>
													<td><?php echo language_translate('services_page_priority');?></td>
													<td>
														<?php echo $pri_array[0];?>
													</td>
													<td>
														<?php echo $v['period'];?>
													</td>
													<td style="text-align:right;"><?php echo euroCurrencyFormat(number_format( $v['payment_price'], 2) );?></td>
												</tr>
											<?php endforeach; ?>
										<?php endif;?> 
										
										<?php if(isset($_SESSION['SERVICES_INFO']['NET_AMOUNT'])):?>
											<tr>
												<td colspan=3></td>
												<td style="text-align:right;"><?php echo euroCurrencyFormat(number_format( $totalPrice, 2) );?></td>
											</tr>
										<?php endif;?>
									</tbody>
								</table>
						 </div>
						<div class="clear"></div>
					</div>
					
					<?php if($iCount):?>			
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('services_page_your_promotion_code');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<span id="promotion-info">
									<?php if($_SESSION['SERVICES_INFO']['DISCOUNT_PROMO_CODE']):?>
										<?php echo $_SESSION['SERVICES_INFO']['DISCOUNT_PROMO_CODE'];?>
											|	
										<?php echo $_SESSION['SERVICES_INFO']['DISCOUNT_PROMO_INFO'];?>
									<?php endif;?>	
									</span>
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('services_page_promo_discount');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<?php echo euroCurrencyFormat(number_format($totalPromoDiscount,2));?> &euro;
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('services_page_total_period_discount');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<?php echo euroCurrencyFormat(number_format($totalPeriodDiscount,2));?> &euro;
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('services_page_net_amount');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<span id="net_amount_price">
										<?php if(isset($_SESSION['SERVICES_INFO']['NET_AMOUNT'])):?>
											<?php echo euroCurrencyFormat(number_format( $_SESSION['SERVICES_INFO']['NET_AMOUNT'],2));?> &euro;
										<?php endif;?>
									</span>									
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('contract_start_date');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<?php echo sysDateFormat($_SESSION['SERVICES_INFO']['STARTDATE'],DATE_FORMAT);?>
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="dashboard-info-wrapper">
							<div class="dashboard-info-left"><span><?php echo language_translate('contract_to_date');?></span></div>
							<div class="dashboard-info-right">
								<div class="select-box">
									<?php echo sysDateFormat($_SESSION['SERVICES_INFO']['ENDDATE'],DATE_FORMAT);?>
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
						</div>
						
					<?php endif;?>
					
					<div class="dashboard-info-wrapper">
					       
                           <form method="post" action="https://sale.GTBill.com/quickpay.aspx"> 
                                
                                <!-- *** Required fields for GTBill --> 
                                <input  name="MerchantID"  type="hidden" value ="<?php echo $gtbillInfoArray[SITE_REF]['MerchantID'];?>" /> 
                                <input  name="SiteID" type="hidden" value ="<?php echo $gtbillInfoArray[SITE_REF]['SiteID'];?>" /> 
                                <input  name="AmountTotal" type="hidden" value ="<?php echo round( $_SESSION['SERVICES_INFO']['NET_AMOUNT'],2 );?>"  /> 
                                <input  name="CurrencyID"  type="hidden" value ="EUR" /> 
                                <input  name="AmountShipping" type="hidden" value ="0" /> 
                                <input  name="ShippingRequired" type="hidden" value ="0" /> 
                                <input  name="ItemName[0]" type="hidden" value ="<?php echo language_translate('gtbill_item_name');?>"  /> 
                                <input  name="ItemQuantity[0]"  type="hidden" value ="1" /> 
                                <input  name="ItemAmount[0]" type="hidden" value ="<?php echo round( $_SESSION['SERVICES_INFO']['NET_AMOUNT'],2 );?>"  /> 
                                <input  name="ItemDesc[0]" type="hidden" value ="<?php echo language_translate('gtbill_item_name');?>"  /> 
                                <input  name="ReturnURL" type="hidden" value ="<?php echo site_url('escorts/transaction_submit/gtbill_process');?>"  /> 
                                 
                                
                                <input class="gtbill_payment_method" name="submit" type="submit" value="<?php echo language_translate('payment_method_gtbill_submit');?>" /> 
                            </form>
                       
					</div>
						
				
	
				<!-- end content -->
			</div>
		</div>
	</div>



<?php $this->load->view('escorts/right_nav'); ?>



<script type="text/javascript">
	$(document).ready(function() { 
		
	});	
	
</script>